package config

import (
	"gitee.com/dreamwood/ez"
)

type ApiConfig struct {
	AuthTokenName   string `yaml:"auth-token-name"`
	AccessTokenName string `yaml:"access-token-name"`
	FileServerName  string `yaml:"file-server-name"`
}

var apiConfig *ApiConfig

func init() {
	CreateApiConfig()
}

func CreateApiConfig() {
	ez.CreateConfigFromYml("./app.yaml", "api", &apiConfig)
}
func GetApi() *ApiConfig {
	if apiConfig == nil {
		CreateApiConfig()
	}
	return apiConfig
}
